<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }
        
        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }
        
        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }
        
        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }
        
        .header-left {
            display: flex;
            align-items: center;
        }
        
        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }
        
        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }
        
        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }
        
        .header-right {
            display: flex;
            align-items: center;
        }
        
        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }
        
        .header-action:hover {
            color: var(--primary-color);
        }
        
        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }
        
        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }
        
        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }
        
        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }
        
        .sidebar-menu {
            padding: 16px 0;
        }
        
        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }
        
        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }
        
        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }
        
        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }
        
        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }
        
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }
        
        .page-title {
            font-size: 24px;
            font-weight: 600;
        }
        
        .page-actions .btn {
            margin-left: 10px;
        }
        
        /* 数据卡片 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 20px;
            margin-bottom: 24px;
        }
        
        .stat-card {
            background: var(--card-bg);
            border-radius: 4px;
            padding: 20px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        
        .stat-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        
        .stat-title {
            font-size: 14px;
            color: var(--text-secondary);
            font-weight: 500;
        }
        
        .stat-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }
        
        .stat-icon.blue {
            background: var(--primary-color);
        }
        
        .stat-icon.green {
            background: var(--success-color);
        }
        
        .stat-icon.orange {
            background: var(--warning-color);
        }
        
        .stat-icon.red {
            background: var(--danger-color);
        }
        
        .stat-value {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .stat-change {
            font-size: 13px;
            display: flex;
            align-items: center;
        }
        
        .stat-change.increase {
            color: var(--success-color);
        }
        
        .stat-change.decrease {
            color: var(--danger-color);
        }
        
        /* 图表区域 */
        .charts-container {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            margin-bottom: 24px;
        }
        
        .chart-card {
            background: var(--card-bg);
            border-radius: 4px;
            padding: 20px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        
        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        
        .chart-title {
            font-size: 16px;
            font-weight: 500;
        }
        
        .chart-actions {
            display: flex;
        }
        
        .chart-action {
            margin-left: 10px;
            color: var(--text-secondary);
            cursor: pointer;
        }
        
        .chart-placeholder {
            height: 250px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
        }
        
        /* 活动列表 */
        .activity-card {
            background: var(--card-bg);
            border-radius: 4px;
            padding: 20px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        
        .activity-list {
            list-style: none;
        }
        
        .activity-item {
            display: flex;
            padding: 16px 0;
            border-bottom: 1px solid var(--border-color);
        }
        
        .activity-item:last-child {
            border-bottom: none;
        }
        
        .activity-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 16px;
            flex-shrink: 0;
        }
        
        .activity-content {
            flex: 1;
        }
        
        .activity-title {
            font-weight: 500;
            margin-bottom: 4px;
        }
        
        .activity-desc {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }
        
        .activity-time {
            font-size: 12px;
            color: var(--text-muted);
        }
        
        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .btn-primary {
            background: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background: #2980b9;
        }
        
        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }
        
        .btn-outline:hover {
            background: #f5f7fa;
        }
        
        /* 响应式设计 */
        @media (max-width: 992px) {
            .charts-container {
                grid-template-columns: 1fr;
            }
            
            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }
            
            .sidebar.open {
                left: 0;
            }
            
            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }
            
            .overlay.open {
                display: block;
            }
        }
        
        @media (max-width: 768px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }
            
            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }
            
            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站后台
            </div>
        </div>
        
        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>
            
            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>
            
            <div class="user-menu">
                <span>管理员</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">主导航</div>
                <a href="#" class="menu-item active">
                    <i class="fas fa-home"></i>
                    <span>控制台</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-paint-brush"></i>
                    <span>网站管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>页面管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-th-large"></i>
                    <span>组件库</span>
                </a>
                
                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>文章管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>产品管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>媒体库</span>
                </a>
                
                <div class="menu-title">用户与权限</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-users"></i>
                    <span>用户管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>角色权限</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-cog"></i>
                    <span>系统设置</span>
                </a>
            </div>
        </div>
        
        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">控制台</h1>
                <div class="page-actions">
                    <button class="btn btn-outline">
                        <i class="fas fa-download"></i> 导出数据
                    </button>
                    <button class="btn btn-primary">
                        <i class="fas fa-plus"></i> 新建网站
                    </button>
                </div>
            </div>
            
            <!-- 数据概览卡片 -->
            <div class="stats-grid">
                <div class="stat-card">
                    <div class="stat-header">
                        <div class="stat-title">网站总数</div>
                        <div class="stat-icon blue">
                            <i class="fas fa-globe"></i>
                        </div>
                    </div>
                    <div class="stat-value">128</div>
                    <div class="stat-change increase">
                        <i class="fas fa-arrow-up"></i> 12% 较上月
                    </div>
                </div>
                
                <div class="stat-card">
                    <div class="stat-header">
                        <div class="stat-title">用户总数</div>
                        <div class="stat-icon green">
                            <i class="fas fa-users"></i>
                        </div>
                    </div>
                    <div class="stat-value">542</div>
                    <div class="stat-change increase">
                        <i class="fas fa-arrow-up"></i> 8% 较上月
                    </div>
                </div>
                
                <div class="stat-card">
                    <div class="stat-header">
                        <div class="stat-title">本月收入</div>
                        <div class="stat-icon orange">
                            <i class="fas fa-yen-sign"></i>
                        </div>
                    </div>
                    <div class="stat-value">¥24,589</div>
                    <div class="stat-change increase">
                        <i class="fas fa-arrow-up"></i> 5% 较上月
                    </div>
                </div>
                
                <div class="stat-card">
                    <div class="stat-header">
                        <div class="stat-title">待处理问题</div>
                        <div class="stat-icon red">
                            <i class="fas fa-exclamation-circle"></i>
                        </div>
                    </div>
                    <div class="stat-value">7</div>
                    <div class="stat-change decrease">
                        <i class="fas fa-arrow-down"></i> 3% 较上月
                    </div>
                </div>
            </div>
            
            <!-- 图表区域 -->
            <div class="charts-container">
                <div class="chart-card">
                    <div class="chart-header">
                        <div class="chart-title">网站访问趋势</div>
                        <div class="chart-actions">
                            <div class="chart-action">
                                <i class="fas fa-sync-alt"></i>
                            </div>
                            <div class="chart-action">
                                <i class="fas fa-expand"></i>
                            </div>
                        </div>
                    </div>
                    <div class="chart-placeholder">
                        <canvas id="trafficChart" height="250"></canvas>
                    </div>
                </div>
                
                <div class="chart-card">
                    <div class="chart-header">
                        <div class="chart-title">用户分布</div>
                        <div class="chart-actions">
                            <div class="chart-action">
                                <i class="fas fa-sync-alt"></i>
                            </div>
                        </div>
                    </div>
                    <div class="chart-placeholder">
                        <canvas id="userChart" height="250"></canvas>
                    </div>
                </div>
            </div>
            
            <!-- 最近活动 -->
            <div class="activity-card">
                <div class="chart-header">
                    <div class="chart-title">最近活动</div>
                    <div class="chart-actions">
                        <div class="chart-action">
                            查看全部 <i class="fas fa-chevron-right"></i>
                        </div>
                    </div>
                </div>
                
                <ul class="activity-list">
                    <li class="activity-item">
                        <div class="activity-icon">
                            <i class="fas fa-plus"></i>
                        </div>
                        <div class="activity-content">
                            <div class="activity-title">新网站创建</div>
                            <div class="activity-desc">用户"张三"创建了新网站"科技公司官网"</div>
                            <div class="activity-time">10分钟前</div>
                        </div>
                    </li>
                    
                    <li class="activity-item">
                        <div class="activity-icon">
                            <i class="fas fa-edit"></i>
                        </div>
                        <div class="activity-content">
                            <div class="activity-title">页面更新</div>
                            <div class="activity-desc">用户"李四"更新了页面"产品介绍"的内容</div>
                            <div class="activity-time">2小时前</div>
                        </div>
                    </li>
                    
                    <li class="activity-item">
                        <div class="activity-icon">
                            <i class="fas fa-user-plus"></i>
                        </div>
                        <div class="activity-content">
                            <div class="activity-title">新用户注册</div>
                            <div class="activity-desc">新用户"王五"通过邀请链接注册了账号</div>
                            <div class="activity-time">5小时前</div>
                        </div>
                    </li>
                    
                    <li class="activity-item">
                        <div class="activity-icon">
                            <i class="fas fa-shield-alt"></i>
                        </div>
                        <div class="activity-content">
                            <div class="activity-title">系统更新</div>
                            <div class="activity-desc">系统安全补丁已自动安装并生效</div>
                            <div class="activity-time">昨天 15:30</div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    
    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 侧边栏切换
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');
            
            sidebarToggle.addEventListener('click', function() {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });
            
            overlay.addEventListener('click', function() {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });
            
            // 初始化流量图表
            const trafficCtx = document.getElementById('trafficChart').getContext('2d');
            const trafficChart = new Chart(trafficCtx, {
                type: 'line',
                data: {
                    labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月'],
                    datasets: [{
                        label: '网站访问量',
                        data: [12000, 19000, 15000, 25000, 22000, 30000, 35000],
                        borderColor: '#3498db',
                        backgroundColor: 'rgba(52, 152, 219, 0.1)',
                        tension: 0.4,
                        fill: true
                    }]
                },
                options: {
                    responsive: true,
                    plugins: {
                        legend: {
                            display: false
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: true,
                            grid: {
                                drawBorder: false
                            }
                        },
                        x: {
                            grid: {
                                display: false
                            }
                        }
                    }
                }
            });
            
            // 初始化用户分布图表
            const userCtx = document.getElementById('userChart').getContext('2d');
            const userChart = new Chart(userCtx, {
                type: 'doughnut',
                data: {
                    labels: ['企业用户', '个人用户', '开发者', '其他'],
                    datasets: [{
                        data: [45, 30, 15, 10],
                        backgroundColor: [
                            '#3498db',
                            '#2ecc71',
                            '#f39c12',
                            '#95a5a6'
                        ],
                        borderWidth: 0
                    }]
                },
                options: {
                    responsive: true,
                    plugins: {
                        legend: {
                            position: 'bottom'
                        }
                    }
                }
            });
        });
    </script>
</body>
</html>